package com.powernode.dataservice.mapper;

import com.powernode.api.model.FinanceAccount;

import java.math.BigDecimal;

public interface FinanceAccountMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(FinanceAccount record);

    int insertSelective(FinanceAccount record);

    FinanceAccount selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(FinanceAccount record);

    int updateByPrimaryKey(FinanceAccount record);

    /**
     * 通过用户id  获取 账户信息
     * @param uid
     * @return
     */
    FinanceAccount selectByUid(Integer uid);


    /**
     * 扣除账户资金
     * @param uid  用户id
     * @param bidMoney 投资金额
     * @return
     */
    int reduceMoney(Integer uid, BigDecimal bidMoney);

    /**
     * 更新 账户 信息  金额
     * @param uid
     * @param rechargeMoney
     * @return
     */
    int updateMoney(Integer uid, BigDecimal rechargeMoney);

}